x86/MSI-X: be more careful during teardown
authorJan Beulich <jbeulich@suse.com>
Thu, 23 Jul 2015 08:14:59 +0000 (10:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Jul 2015 08:14:59 +0000 (10:14 +0200)
commit082fdc6ce85e5b603f8fb24553cf200e3b67889f
tree7cbb1b2e269b8b04eaa182726140371565277d5e
parent484d7c852e4ff79c945406ed28b5db63a5a0b7f3
x86/MSI-X: be more careful during teardown

When a device gets detached from a guest, pciback will clear its
command register, thus disabling both memory and I/O decoding. The
disabled memory decoding, however, has an effect on the MSI-X table
accesses the hypervisor does: These won't have the intended effect
anymore. Even worse, for PCIe devices (but not SR-IOV virtual
functions) such accesses may (will?) be treated as Unsupported
Requests, causing respective errors to be surfaced, potentially in the
form of NMIs that may be fatal to the hypervisor or Dom0 is different
ways. Hence rather than carrying out these accesses, we should avoid
them where we can, and use alternative (e.g. PCI config space based)
mechanisms to achieve at least the same effect.

At this time it continues to be unclear whether this is fixing an
actual bug or is rather just working around bogus (but apparently
common) system behavior.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/irq.c
xen/arch/x86/msi.c